//
//  AppDelegate.m
//  MVVM+RAC
//
//  Created by bopeng on 16/5/13.
//  Copyright © 2016年 Scott. All rights reserved.
//

#import "AppDelegate.h"
#import "TopWindowViewController.h"
#import "Student.h"
#import "TestViewController.h"
#import "DIYButton.h"

@interface AppDelegate ()

@property (nonatomic, strong) UIWindow *topWindow;

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    
    _topWindow = [[UIWindow alloc] init];
    _topWindow.frame = application.statusBarFrame;
    _topWindow.windowLevel = UIWindowLevelAlert;
    _topWindow.backgroundColor = [UIColor clearColor];
    TopWindowViewController *topVC = [[TopWindowViewController alloc] init];
    topVC.statusBarSty = UIStatusBarStyleLightContent;
    _topWindow.rootViewController = topVC;
    _topWindow.hidden = NO;
    
    [self setUpappearance];
    
    
    Student *s = [[Student alloc] init];
    [s study];
    
    return YES;
}

- (void)setUpappearance {
    UINavigationBar *navigationBar = [UINavigationBar appearance];
    navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:NSForegroundColorAttributeName];
    [navigationBar setBarTintColor:[UIColor redColor]];
    
//    UIImage *image = [UIImage imageNamed:@"home_nav_bar_fullscreen_back_icon_highlight"];
//    image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//    navigationBar.backIndicatorImage = image;
//    navigationBar.backIndicatorTransitionMaskImage = image;
    
    navigationBar.tintColor = [UIColor whiteColor];
    
    UIBarButtonItem *barItem = [UIBarButtonItem appearance];
    [barItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]} forState:UIControlStateNormal];
    [barItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor lightGrayColor]} forState:UIControlStateDisabled];
    [barItem setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -100) forBarMetrics:UIBarMetricsDefault];
}


- (void)applicationWillResignActive:(UIApplication *)application {}

- (void)applicationDidEnterBackground:(UIApplication *)application {
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
}

- (void)applicationWillTerminate:(UIApplication *)application {
}

@end
